package com.turing.post.transaction.util;

import java.io.Serializable;
import java.math.BigInteger;

import com.turing.post.util.PCPSUtil;

@SuppressWarnings("serial")
public class ChkAccFileDetail implements Serializable {
	/**
	 * 请求流水号
	 */
	private String reqSeqNo;

	public String getReqSeqNo() {
		return reqSeqNo;
	}

	public void setReqSeqNo(String reqSeqNo) {
		this.reqSeqNo = reqSeqNo;
	}

	/**
	 * 应答流水号
	 */
	private String ackSeqNo;

	public String getAckSeqNo() {
		return ackSeqNo;
	}

	public void setAckSeqNo(String ackSeqNo) {
		this.ackSeqNo = ackSeqNo;
	}

	/**
	 * 交易金额
	 */
	private BigInteger amount;

	public BigInteger getAmount() {
		return amount;
	}

	public void setAmount(BigInteger amount) {
		this.amount = amount;
	}

	/**
	 * 消费
	 */
	public final static String PAID = "0";

	/**
	 * 消费撤销/退货
	 */
	public final static String PAIDCANCEL = "1";

	/**
	 * 充值
	 */
	public final static String DEPOSIT = "2";

	/**
	 * 交易类型
	 */
	private String tranType;

	public String getTranType() {
		return tranType;
	}

	public void setTranType(String tranType) {
		this.tranType = tranType;
	}

	/**
	 * 检查交易类型是否一致
	 * 
	 * @param cafd
	 * @return
	 */
	public static boolean checkTranType(ChkAccFileDetail cafd) {
		if (cafd == null)
			return false;
		if (PCPSUtil.compareObject(cafd.getTranType(), ChkAccFileDetail.PAID))
			return true;
		if (PCPSUtil.compareObject(cafd.getTranType(),
				ChkAccFileDetail.PAIDCANCEL))
			return true;
		if (PCPSUtil
				.compareObject(cafd.getTranType(), ChkAccFileDetail.DEPOSIT))
			return true;
		return false;
	}
}
